<?php
/**
 *@file reportlist.php
 *@author YangLiu
 *@date 2015-7-13 ����14:13:22
 *@brief  
 */
namespace haibao\comment\data;

class Reportlist extends \haibao\comment\data\BaseMysql{
    
	public function __construct() {
		parent::__construct ( '\haibao\comment\model\data\commentreportlog' );
		$this->setConfig( \haibao\classlibrary\www\Config::CLASSLIBRARY_CONFIG_MYSQL_HAIBAO_USER );
	}
	
	public function getReportUserNameById($Ids){
	    $this->setConfig( \haibao\classlibrary\comment\Config::CLASSLIBRARY_CONFIG_MYSQL_HAIBAO_DZ3 );
	    $userNamedata = array();
	    $str = preg_replace('/(\d+)/', '%s', implode(',', $Ids));
	    $sql = "select * from `auth_user` where id in (".$str.")";
		$result = $this->query($sql, $Ids);
		
	    while($row=$result->fetch_assoc()){
	        $userNamedata[$row['id']] = $result->getData('username');
	    }
	    return $userNamedata;
	}
	public function getCommentBan($commentUserIdList){
	    $resArr = array();
        if (!empty($commentUserIdList)){
            $userId = preg_replace('/(\d+)/', '%s', implode(',', $commentUserIdList));
            $sqlUser = "select Id,UserId from `CommentBan` where UserId in (".$userId.") and BanStatus=".\haibao\comment\model\data\CommentBan::BAN_STATUS_NO;
            $resultUser = $this->query($sqlUser,$commentUserIdList);
            while($resultUser->fetch_assoc()){
                $resArr[$resultUser->getData('UserId')] = $resultUser->getData('Id');
            }
        }
	    return $resArr;
	}
	
}